cmake_minimum_required (VERSION 2.8)
project (SagittariusSandbox)

#include_directories(${LLVMGeneratedIncludePath})
add_executable(llvm_ee_bin llvm_ee.cpp)
target_link_libraries(llvm_ee_bin sagittarius ${LLVM_LIBRARIES} ${LLVMAuxLibraries})

configure_file(llvm_ee.in llvm_ee_out)

#file(MAKE_DIRECTORY bin)
#file(INSTALL ${CMAKE_CURRENT_BINARY_DIR}/llvm_ee_bin DESTINATION bin) #PERMISSIONS=OWNER_EXECUTE)
if(NOT ${WIN32})
    add_custom_command(OUTPUT dummy COMMAND chmod u+x llvm_ee_out)
    add_custom_target(unsub ALL DEPENDS dummy)
endif()
#add_dependencies(bin/llvm_ee_bin ${CMAKE_CURRENT_BINARY_DIR}/llvm_ee_bin)
#file(INSTALL ${CMAKE_CURRENT_BINARY_DIR}/llvm_ee_out DESTINATION bin PERMISSIONS OWNER_READ OWNER_EXECUTE) #Cannot use permissions with copy

add_executable(llvm_inline llvm_inline.cpp)
target_link_libraries(llvm_inline sagittarius ${LLVM_LIBRARIES} ${LLVMAuxLibraries})

# add_executable(llvm_alloca_scoping llvm_alloca_scoping.cpp)
# target_link_libraries(llvm_alloca_scoping sagittarius ${LLVM_LIBRARIES} ${LLVMAuxLibraries})

# add_executable(llvm_globals llvm_globals.cpp)
# target_link_libraries(llvm_globals sagittarius ${LLVM_LIBRARIES} ${LLVMAuxLibraries})
